<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        function sort(num1, num2, num3) {
            // var temp = 0
            // if (num1 > num2) {
            //     temp = num1
            //     num1 = num2
            //     num2 = temp
            // }
            // if (num2 > num3) {
            //     temp = num2
            //     num2 = num3
            //     num3 = temp
            // }
            // if (num1 > num2) {
            //     temp = num1
            //     num1 = num2
            //     num2 = temp
            // }
            // console.log(num1, num2, num3)


            var max = Math.max(num1, num2, num3)
            var min = Math.min(num1, num2, num3)
            var mid = num1 + num2 + num3 - max - min
            console.log(min, mid, max)
        }
        sort(20, 10, 999999)
    </script>
</body>

</html>